//
//  TYHitTestView.m
//  TYUIKit
//
//  Created by TuyaInc on 2019/12/5.
//

#import "TYHitTestView.h"

@implementation TYHitTestView

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
    UIView *view = [super hitTest:point withEvent:event];
    return self.ty_hitTestBlock ? self.ty_hitTestBlock(point, event, view) : view;
}

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
    BOOL inside = [super pointInside:point withEvent:event];
    BOOL result = self.ty_pointInsideBlock ? self.ty_pointInsideBlock(point, event, inside) : inside;
    return result;
}

@end
